package com.sugon.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.sugon.dao.DevStatusLiveRecordDao;
import com.sugon.entity.DevStatusLiveRecordEntity;
import com.sugon.service.DevStatusLiveRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 设备状态实时记录表，一台设备对应一条状态记录Service实现类
 *
 * @author sugon
 * @date 2020-12-23 11:42:55
 */
@Service("devStatusLiveRecordService")
public class DevStatusLiveRecordServiceImpl implements DevStatusLiveRecordService {
    @Autowired
    private DevStatusLiveRecordDao devStatusLiveRecordDao;

    @Override
    public DevStatusLiveRecordEntity queryObject(String id) {
        return devStatusLiveRecordDao.queryObject(id);
    }

    @Override
    public List<DevStatusLiveRecordEntity> queryList(Map<String, Object> map) {
        return devStatusLiveRecordDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return devStatusLiveRecordDao.queryTotal(map);
    }

    @Override
    public int save(DevStatusLiveRecordEntity devStatusLiveRecord) {
        devStatusLiveRecord.setId(RandomUtil.randomString(32));
        return devStatusLiveRecordDao.save(devStatusLiveRecord);
    }

    @Override
    public int update(DevStatusLiveRecordEntity devStatusLiveRecord) {
        return devStatusLiveRecordDao.update(devStatusLiveRecord);
    }

    @Override
    public int delete(String id) {
        return devStatusLiveRecordDao.delete(id);
    }

    @Override
    public int deleteBatch(String[] ids) {
        return devStatusLiveRecordDao.deleteBatch(ids);
    }
}
